import React from 'react';
import { BrowserRouter as Router, Route, Link } from 'react-router-dom'
import Index from './pages/Index'
import List from './pages/List'
import Home from './pages/Home'

function IndexS () {
    return <h2>hello, world</h2>
}

function ListS () {
    return <h2>List-page</h2>
}

function AppRouter () {
    return (
        <Router>
            <ul>
                <li><Link to="/">首页</Link></li>
                <li><Link to="/list/56">列表</Link></li>

            </ul>
            {/* exact 精准匹配 */}
            <Route path="/" exact component={Index} />
            <Route path="/list/:id" component={List} />
            <Route path="/home" component={Home} />
        </Router>
    )
}

export default AppRouter;